package com.demo.design.creational.simplefactory;

public class FriutsFactory {

    public Fruit getFruits(String name) {
        Fruit fruit = null;
        if (name == null) {
            return null;
        }
        if ("apple".equals(name)) {
            fruit = new Apple();
        } else if ("banana".equals(name)) {
            fruit = new Banana();
        }
        return fruit;
    }
}
